import factory from '@adonisjs/lucid/factories'
import Shop from '#models/shop'
import { DateTime } from 'luxon'

export const ShopFactory = factory
  .define(Shop, ({ faker }) => {
    return {
      name: faker.animal.snake(),
      logo: faker.image.avatar(),
      address: faker.location.streetAddress(),
      openTime: DateTime.fromFormat(faker.date.anytime().toISOString(), 'HH:mm:ss').toString(),
      closeTime: DateTime.fromFormat(faker.date.anytime().toISOString(), 'HH:mm:ss').toString(),
      minShow: faker.datatype.boolean(),
      level: faker.number.int({ min: 1, max: 3 }),
      location: {
        latitude: faker.location.latitude(),
        longitude: faker.location.longitude(),
      },
      memo: faker.word.words(20),
      createUser: faker.internet.userName(),
      updateUser: faker.internet.userName(),
    }
  })
  .build()
